version: '3.8'
services:
  springboot-app:
    image: client:0.0.2
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
    depends_on:
      - database
    env_file:
      - ./.env

  database:
    image: postgres:latest
    container_name: db
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
      POSTGRES_DB: bot_database
    ports:
      - "15432:5432"
    volumes:
      - db-data:/var/lib/postgresql/data
    restart: always

  pgadmin:
    container_name: pgadmin4_container
    image: dpage/pgadmin4:7
    restart: always
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@admin.com
      PGADMIN_DEFAULT_PASSWORD: root
    ports:
      - "5050:80"
    volumes:
      - pgadmin-data:/var/lib/pgadmin

volumes:
  db-data:
  pgadmin-data: